package cn.qxq1.exception;

import org.springframework.web.servlet.HandlerExceptionResolver;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @author zhangying
 * @date 2020-04-26
 * @description
 */
//@Component
public class ExceptionHandler implements HandlerExceptionResolver {
    public ModelAndView resolveException(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) {
        System.out.println("request:"+httpServletRequest);
        System.out.println("httpServletResponse = " + httpServletResponse);
        System.out.println(e.getMessage());
        return new ModelAndView("redirect:/404.html");
    }
}
